<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="content">
		<f:view>


			<h:form>

				<h2>
					<h:outputText value="#{global.analyzer_view_title}" />
				</h2>

				<a4j:outputPanel rendered="#{empty accessLogMB.accessLogs}">
					No Access Log Files defined. <br />Please create first a Log File definition.
				</a4j:outputPanel>

				<a4j:outputPanel rendered="#{! empty accessLogMB.accessLogs}">
					<rich:dataTable id="datatable_id" columns="7"
						value="#{analyzerMB.analyzers}" var="record">


						<rich:column  style="width:300px;" sortBy="#{record.id}" sortable="true"
							sortExpression="#{record.id}">
							<f:facet name="header">
								<h:outputText value="Name" />
							</f:facet>
							<h:commandLink action="/pages/analyzer">
								<h:outputText value="#{record.name}" />
								<f:setPropertyActionListener target="#{analyzerMB.analyzer}"
									value="#{record}" />
							</h:commandLink>
							
							
						</rich:column>



						<rich:column style="width:100px;"> 
							<f:facet name="header">
								<h:outputText value="#{global.analyzer_log}" />
							</f:facet>
							<h:outputText value="#{record.accessLog.name}" />
						</rich:column>
						
						

						<!-- delete -->
						<rich:column>
							<h:commandLink value="#{global.delete}"
								action="#{analyzerMB.deleteAnalyzer}">
								<f:setPropertyActionListener target="#{analyzerMB.analyzer}"
									value="#{record}" />
							</h:commandLink>
						</rich:column>

					</rich:dataTable>



					<h:commandButton actionListener="#{analyzerMB.doCreate}"
						action="analyzer" value="#{global.add}">
					</h:commandButton>
				</a4j:outputPanel>

			</h:form>
		</f:view>
	</ui:define>

</ui:composition>